define(['egis'],
    function (egis) {
        Window.deserializer = Window.deserializer || new egis.core.Deserializer();
        Window.container = Window.container || {};
        dsBridge.register('create_CommandManager', function (sourceId) {
            var manager = new egis.gdm.CommandManager();
            Window.container[sourceId] = manager;
        });

        dsBridge.register('CommandManager_add', function (sourceId, toolId) {
            var manager = Window.container[sourceId];
            var tool = Window.container[toolId];
            manager.add(tool);
        });

        dsBridge.register('CommandManager_remove', function (sourceId, toolId) {
            var manager = Window.container[sourceId];
            var tool = Window.container[toolId];
            manager.remove(tool);
        });

        dsBridge.register('CommandManager_onCreate', function (sourceId, containerId) {
            try {
                var manager = Window.container[sourceId];
                var container = Window.container[containerId];
                manager.onCreate(container._map);
            }
            catch (e) {
                alert(e)
            }
        });
    })

